package com.dongqi.deviceData.controller;

import com.dongqi.deviceData.dto.DeviceDataDTO;
import com.dongqi.deviceData.service.DeviceDataService;
import com.dongqi.utils.RestResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 设备数据控制器
 */
@Slf4j
@RestController
@RequestMapping(value = "/deviceData")
public class DeviceDataController {
    @Autowired
    private DeviceDataService deviceDataService;


    /**
     * 查询所有的设备数据
     * @param
     * @return DeviceDataDT deviceDataDTO
     */
    @GetMapping("/query")
    public RestResult query() {
        DeviceDataDTO deviceDataDTO = deviceDataService.queryAll();
        return RestResult.success(deviceDataDTO);
    }

}
